* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 2400px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 5px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 300;
    color: #34495e;
    letter-spacing: -0.5px;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 1px solid #e8eaed;
}

.heatmap-chart {
    width: 100%;
    height: 700px;
    border-radius: 8px;
}

.controls {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8eaed;
}

.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-right: 12px;
    margin-bottom: 12px;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-warning {
    background: #f39c12;
}

.btn-warning:hover {
    background: #e67e22;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* WebSocket连接控制样式 */
.websocket-controls {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.connection-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.input-field {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 120px;
}

.input-field:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn-primary {
    background: #27ae60;
}

.btn-primary:hover {
    background: #229954;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-secondary {
    background: #e74c3c;
}

.btn-secondary:hover {
    background: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-info {
    background: #17a2b8;
}

.btn-info:hover {
    background: #138496;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    background: #bdc3c7;
    transform: none;
    box-shadow: none;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-status span {
    font-size: 14px;
    font-weight: 500;
}

.status-connected {
    color: #27ae60;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    margin-left: 8px;
}

.status-disconnected {
    color: #e74c3c;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    margin-left: 8px;
}

.status-connecting {
    color: #f39c12;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    margin-left: 8px;
}

.data-controls {
    margin-top: 20px;
}

.auto-update-controls {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auto-update-controls .input-field {
    width: 120px;
}

/* 检出统计表格样式 */
.detection-table-container {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detection-table-container h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.detection-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}

.detection-table th {
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.detection-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
    color: #555;
}

.detection-table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.detection-table tbody tr:last-child td {
    border-bottom: none;
}

/* 检出次数高亮显示 - 与热力图颜色映射保持一致 */
.detection-count {
    font-weight: 600;
    color: #2196f3;
}

.detection-count.low {
    color: #2196f3; /* 蓝色，对应1-10次 */
    font-weight: 600;
}

.detection-count.medium {
    color: #ffeb3b; /* 黄色，对应10-50次 */
    font-weight: 600;
}

.detection-count.medium-high {
    color: #ff9800; /* 橙色，对应50-200次 */
    font-weight: 600;
}

.detection-count.high {
    color: #f44336; /* 红色，对应200-500次 */
    font-weight: 600;
}

.detection-count.very-high {
    color: #b71c1c; /* 深红色，对应500次以上 */
    font-weight: 600;
}

/* 相似度值样式 */
.similarity-value {
    font-weight: 600;
    color: #4caf50; /* 绿色 */
}

/* 空表格状态 */
.detection-table tbody tr.empty-row td {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 30px 15px;
}

.data-info {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.data-info span {
    display: inline-block;
    margin-right: 30px;
    color: #495057;
    font-size: 0.9rem;
}

.data-info span span {
    color: #3498db;
    font-weight: 600;
    margin-left: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .heatmap-chart {
        height: 350px;
    }
    
    .connection-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-field {
        width: 100%;
    }
    
    .data-info span {
        display: block;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
    }
}

/* 工具提示样式 */
.echarts-tooltip {
    background: rgba(44, 62, 80, 0.95) !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    color: white !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
}
